package cn.nawang.ebeim.api.repository.impl;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import cn.nawang.ebeim.api.comm.BaseQuery;
import cn.nawang.ebeim.api.domain.CustomerEncryption;

/**
 * @ClassName: CustomerEncryptionRepositoryImpl
 * @Description: TODO
 * @author fanyb
 * @date Oct 23, 2015 4:13:32 PM
 * @version v1.0
 */

public class CustomerEncryptionRepositoryImpl extends BaseQuery{

  public CustomerEncryption findByCustomerId(String customerId){
    String hql="from CustomerEncryption ce where ce.customerId=:customerId";
    Map<String,Object> paraMap = new HashMap<String,Object>();
    try{
      paraMap.put("customerId", customerId);
      List<CustomerEncryption> customerEncryption = queryObject(hql,paraMap);
      if(customerEncryption!=null && !customerEncryption.isEmpty()){
        return customerEncryption.get(0);
      }
    }catch(Exception ex){
      ex.printStackTrace();
    }
    return null;
  }
}
